/*
* (c) 2014 University of Applied Sciences, Karlsruhe
* Project "Segmentation of depth data of a plenoptic camera"
* summer semester 2014
*
* image_preprocessing_2d.cpp
* Implementation of image_preprocessing_2d.h.
*/

#include "sgMain/2d/edge_detection_2d.h"
#include "sgExecution/image_preprocessing_2d.h"

using namespace sgMain;

namespace sgExecution
{
	cv::Mat ImagePreprocessing2D::CreateContourImageUsingCanny(cv::Mat colorImage, int lowerThreshold)
	{
		// Canny edge detection
		cv::Mat colorImageAfterEdgeDetection = EdgeDetection2D::CannyEdgeDetector(colorImage, lowerThreshold);


		std::vector<std::vector<cv::Point>> contours;
		std::vector<cv::Vec4i> hierarchy;
		cv::Mat edgeImageBlackWhite = ImageHelper::ConvertToBlackAndWhite(colorImageAfterEdgeDetection);

		return edgeImageBlackWhite;
	}
}